package com.cyys.modules.core.model;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.util.List;


@Data
public class TreeBean<T extends TreeBean> extends CoreBean {

	private String parentId;   //父编号

	@TableField(exist = false)
	private String parentName;
	
	private Integer hasChild;  //是否有子菜单
	
	private Integer sort;    //排序

	@TableField(exist = false)
	private List<T> children;

	@TableField(exist = false)
	protected Boolean isRoot = true;

//	public void add(T node) {
//		children.add(node);
//	}

	public void add(T node) {
		this.children.add(node);
	}
}
